{include file="public/head" /}
<!--有理想的地方，地狱都是天堂-->
<!--Copyright @ df81.com 版权所有-->
<!--作者: 南国老符 邮箱：1062129401@qq.com-->
        <!-- 左侧菜单 开始 -->
        <div class="sidebar">
            <nav>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy d-block d-md-none" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_content" /}
                </ul>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy d-block d-md-none" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_data" /}
                </ul>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy d-block d-md-none" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_global" /}
                </ul>
                <ul class="nav nav-pills nav-sidebar flex-column nav-flat nav-legacy" data-widget="treeview" role="menu" data-accordion="false">
                    {include file="public/left_system" /}
                </ul>
            </nav>
        </div>
        <!-- 左侧菜单 结束 -->
    </aside>
    <!-- 左侧 结束 -->
    <!-- 右侧 开始 -->
    <div class="content-wrapper">
        <!-- 内容导航 开始 -->
        <div class="content-header py-2 bg-white mb-3">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-sm-12">
                        <ol class="breadcrumb">
                            <li>{:lang('g_system')} {:lang('v_setting')}<i class="fas fa-angle-right mx-2"></i></li>
                            <li>{:lang('g_system')} {:lang('v_setting')}<i class="fas fa-angle-right mx-2"></i></li>
                            <li>{:lang('v_social')} {:lang('v_login')}<i class="fas fa-angle-right mx-2"></i></li>
                            <li>{:lang('v_wechat')} {:lang('v_login')}</li>
                        </ol>
                    </div>
                </div>
            </div>
        </div>
        <!-- 内容导航 结束 -->
        <!-- 内容主体 开始 -->
        <section class="content">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-md-12">
                        <div class="card card-outline card-success">
                            <div class="card-header"><i class="fab fa-fw fa-weixin text-success mr-1"></i>{:lang('v_wechat')} {:lang('v_login')}</div>
                            <div class="card-body">
                                <form name="form_edit" id="form_edit" method="post">
                                    <input type="hidden" name="lang" value="{$lang}">
                                    <input type="hidden" name="type" value="wepay">
                                    <div class="row form-group d-none">
                                        <div class="col-md-3 text-right">登录方式</div>
                                        <div class="col-md-4">
                                            <label class="form-check form-check-inline">
                                                <input type="radio" name="login_type" value="mp_weixin" checked="checked" class="form-check-input">{:lang('v_wechat')} {:lang('v_wechat_public')}
                                            </label>
                                            <label class="form-check form-check-inline">
                                                <input type="radio" name="login_type" value="open_weixin" class="form-check-input">微信开放平台
                                            </label>
                                        </div>
                                    </div>
                                    <!-- 微信服务号 -->
                                    <div id="mp_weixin">
                                        <div class="row mb-2">
                                            <div class="offset-md-3 col-md-4">
                                                <div class="w-100">
                                                    <span class="font-weight-bold text-success">{:lang('v_wechat')} {:lang('v_wechat_public')}【 <a class="text-success" href="https://mp.weixin.qq.com/" target="_blank">{:lang('v_apply')} &raquo;</a> 】</span>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row form-group">
                                            <div class="col-md-3 col-form-label text-right">{:lang('v_developer')} ID(AppID)</div>
                                            <div class="col-md-4">
                                                <input type="text" class="form-control" name="wepay_appid" value="{:config('wechat.wechat.app_id')}" />
                                            </div>
                                        </div>
                                        <div class="row form-group">
                                            <div class="col-md-3 col-form-label text-right">{:lang('v_developer')} {:lang('v_password')}(AppSecret)</div>
                                            <div class="col-md-4">
                                                <input type="text" class="form-control" name="wepay_appkey" value="{:config('wechat.wechat.secret')}" />
                                            </div>
                                        </div>
                                        <div class="row form-group">
                                            <div class="col-md-3 text-right">{:lang('v_server_ip')}</div>
                                            <div class="col-md-4">http(s)://www.{:lang('v_yourdomain')}.com/api/wechat/server.html</div>
                                        </div>
                                        <div class="row form-group">
                                            <div class="col-md-3 col-form-label text-right">Token</div>
                                            <div class="col-md-4">
                                                <input type="text" class="form-control" name="wepay_token" value="{:config('wechat.wechat.token')}" />
                                            </div>
                                        </div>
                                        <div class="row form-group">
                                            <div class="col-md-3 col-form-label text-right">{:lang('v_info_secret')}(EncodingAESKey)</div>
                                            <div class="col-md-4">
                                                <input type="text" class="form-control" name="wepay_aeskey" value="{:config('wechat.wechat.aes_key')}" />
                                            </div>
                                        </div>
                                        <div class="row form-group d-none">
                                            <div class="col-md-3 col-form-label text-right">{:lang('v_web_auth')} scopes</div>
                                            <div class="col-md-4">
                                                <select name="wepay_scopes" class="form-control">
                                                    <option value="snsapi_userinfo">snsapi_userinfo</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="row form-group d-none">
                                            <div class="col-md-3 col-form-label text-right">{:lang('shopv_web_auth')} {:lang('v_callback_url')}</div>
                                            <div class="col-md-4">
                                                <input type="text" class="form-control" name="wepay_callback" value="{$domain}/cn/wechat/oauth.html" />
                                                {$domain}/cn/wechat/oauth.html
                                            </div>
                                        </div>
                                        <div class="d-none">
                                            <div class="row mb-2 text-success font-weight-bold">
                                                <div class="offset-md-3 col-md-4">B、{:lang('v_wechat')} {:lang('v_payment')}【 <a class="text-success" href="https://pay.weixin.qq.com/" target="_blank">{:lang('v_apply')} &raquo;</a> 】</div>
                                            </div>
                                            <div class="row form-group">
                                                <div class="col-md-3 col-form-label text-right">{:lang('shopv_mch_id')}</div>
                                                <div class="col-md-4">
                                                    <input type="text" class="form-control" name="wepay_mch_id" value="{:config('wechat.wechat.mch_id')}" />
                                                </div>
                                            </div>
                                            <div class="row form-group">
                                                <div class="col-md-3 col-form-label text-right">API {:lang('shopv_secret_key')}</div>
                                                <div class="col-md-4">
                                                    <input type="text" class="form-control" name="wepay_key" value="{:config('wechat.wechat.key')}" />
                                                </div>
                                            </div>
                                            <div class="row form-group">
                                                <div class="col-md-3 text-right">支付授权目录</div>
                                                <div class="col-md-4">
                                                    http(s)://www.{:lang('v_yourdomain')}.com/api/payfor/
                                                </div>
                                            </div>
                                            <div class="row form-group">
                                                <div class="col-md-3 text-right">{:lang('shopv_pay_callback')}</div>
                                                <div class="col-md-4">
                                                    <input type="text" class="form-control" name="wepay_notify_url" value="{:config('wechat.wechat.notify_url')}" />http(s)://www.{:lang('v_yourdomain')}.com/api/shop_order/wechat_notify.html
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <!-- 微信开放平台 -->
                                    <div id="open_weixin" class="d-none">
                                        <div class="row mb-2">
                                            <div class="offset-md-3 col-md-4">
                                                <div class="w-100">
                                                    <span class="font-weight-bold text-success">微信开放平台【 <a class="text-success" href="https://open.weixin.qq.com/" target="_blank">{:lang('v_apply')} &raquo;</a> 】</span>
                                                    <!-- <span class="text-danger">（微信浏览器直接调起微信登录）</span> -->
                                                </div>
                                            </div>
                                        </div>
                                        <div class="row form-group">
                                            <div class="col-md-3 col-form-label text-right">APP ID</div>
                                            <div class="col-md-4">
                                                <input type="text" class="form-control" name="weixin_appid" value="{:config('social.weixin.app_key')}" />
                                            </div>
                                        </div>
                                        <div class="row form-group">
                                            <div class="col-md-3 col-form-label text-right">APP SECRET</div>
                                            <div class="col-md-4">
                                                <input type="text" class="form-control" name="weixin_appkey" value="{:config('social.weixin.app_secret')}" />
                                            </div>
                                        </div>
                                        <div class="row form-group">
                                            <div class="col-md-3 col-form-label text-right">回调地址</div>
                                            <div class="col-md-4 text-muted">
                                                <input type="text" class="form-control" name="weixin_callback" value="{:config('social.weixin.callback')}" />
                                                http(s)://www.您的域名.com/api/social/callback.html?type=weixin
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="offset-md-3 col-md-9 mb-4" id="mp_submit">
                                            <button type="button" class="do_ajax btn btn-success mr-4" onclick="javascript:do_ajax('#form_edit','.do_ajax','{:url('/payment/edit',['lang'=>$lang,'type'=>'wepay'])}','{:url('/social/index',['lang'=>$lang])}');"><i class="fas fa-check-circle mr-2"></i>{:lang('v_save')}</button>
                                            <button type="button" class="btn btn-default" onclick="javascript:history.back(-1);"><i class="fa fa-angle-double-left mr-1"></i>{:lang('v_goback')}</button>
                                        </div>
                                        <div class="offset-md-3 col-md-9 mb-4 d-none" id="open_submit">
                                            <button type="button" class="do_ajax btn btn-success mr-4" onclick="javascript:do_ajax('#form_edit','.do_ajax','{:url('/social/edit',['lang'=>$lang,'type'=>'weixin'])}','{:url('/social/index',['lang'=>$lang])}');"><i class="fas fa-check-circle mr-2"></i>{:lang('v_save')}</button>
                                            <button type="button" class="btn btn-default" onclick="javascript:history.back(-1);"><i class="fa fa-angle-double-left mr-1"></i>{:lang('v_goback')}</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
        <!-- 内容主体 结束 -->
    </div>
    <!-- 右侧 结束 -->
{include file="public/foot" /}
<script type="text/javascript">
//类型切换
$('input[name="login_type"]').click(function(){
    if($(this).val() == 'open_weixin'){
        $('#open_weixin').removeClass("d-none");
        $('#mp_weixin').addClass("d-none");
        $('#open_submit').removeClass("d-none");
        $('#mp_submit').addClass("d-none");
        $('input[name="type"]').val('weixin');
    }else{
        $('#open_weixin').addClass("d-none");
        $('#mp_weixin').removeClass("d-none");
        $('#open_submit').addClass("d-none");
        $('#mp_submit').removeClass("d-none");
        $('input[name="type"]').val('wepay');
    }
});
</script>
</body>
</html>